package com.example.lhsama.controller;

import com.example.lhsama.domain.Member;
import com.example.lhsama.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.xml.ws.soap.Addressing;

@Controller
@RequestMapping("member")
public class MemberController {
    @Autowired
    private MemberService memberService;

    @GetMapping("/detail/{id}")
    public String detail(Model model, @PathVariable Integer id){
        Member byId = memberService.getById(id);
        model.addAttribute("member",byId);
        return "/pages/memberDetail";

    }
}
